import VueRouter from 'vue-router'

import HomeContainer from './compontents/tabbar/HomeContainer.vue'
import MemberContainer from './compontents/tabbar/MemberContainer.vue'
import ShopcarContainer from './compontents/tabbar/ShopcarContainer.vue'
import SearchContainer from './compontents/tabbar/SearchContainer.vue'

import NewsList from './compontents/news/NewsList.vue'
import NewsInfo from './compontents/news/NewsInfo.vue'

import PhotoList from './compontents/photo/Photolist.vue'
import Photoinfo from './compontents/photo/Photoinfo.vue'


import GoodsList from './compontents/goods/GoodsList.vue'
import Goodsinfo from './compontents/goods/Goodsinfo.vue'


// 3. 创建路由对象
var router = new VueRouter({
  routes: [
      {
        path:'/',
        redirect:'/home'
      },
      {
        path:'/home',
        component:HomeContainer
      },{
        path:'/member',
        component:MemberContainer
      },{
        path:'/shopcar',
        component:ShopcarContainer
      },{
        path:'/search',
        component:SearchContainer
      },{
        path:'/home/newslist',
        component:NewsList
      },{
        path:'/home/newsinfo/:id',
        component:NewsInfo
      },{
        path:'/home/photolist',
        component:PhotoList
      },{
        path:'/home/photoinfo/:id',
        component:Photoinfo
      },{
        path:'/home/goodslist',
        component:GoodsList
      },{
        path:'/home/goodsinfo/:id',
          component:Goodsinfo,
          name:'goodsinfo'//路由名字
      }
  ],
    linkActiveClass:'mui-active'//覆盖默认路由高亮类,默认类叫:router-link-active
})

// 把路由对象暴露出去
export default router